<? 
include_once("codelibrary/inc/variables.php");
include_once("session.php");
include_once("codelibrary/inc/functions.php");

$business_id = $_SESSION['business_id'];

if(isset($_REQUEST['staff_id']))
{
	$staff_id = $_REQUEST['staff_id'];
	$qry = mysql_query("select * from staff where staff_id = '".$staff_id."' and business_id = '".$business_id."'");
	$record = mysql_fetch_array($qry);
}
if(isset($_REQUEST['Update']))
{
	$f_name = $_REQUEST['f_name'];
	$l_name = $_REQUEST['l_name'];
	$s_name = $_REQUEST['s_name'];
	$c_name = $_REQUEST['c_name'];
	$address = $_REQUEST['address'];
	$city = $_REQUEST['city'];
	$state = $_REQUEST['state'];
	$zip = $_REQUEST['zip'];
	$email = $_REQUEST['email'];
	$home = $_REQUEST['home'];
	$office = $_REQUEST['office'];
	$mobile = $_REQUEST['mobile'];
	$fax = $_REQUEST['fax'];
	$status = $_REQUEST['status'];
	$customersee = $_REQUEST['customersee'];
	$access_type = $_REQUEST['access_type'];
	$member_type = $_REQUEST['member_type'];
	$login = $_REQUEST['login'];
	$password = $_REQUEST['password'];

mysql_query("update staff set first_name ='".$f_name."', last_name='".$l_name."', screen_name='".$s_name."', company='".$c_name."', address='".$address."', city='".$city."', state='".$state."', zip='".$zip."', email='".$email."', phone='".$home."', office='".$office."', mobile='".$mobile."', fax='".$fax."', status='".$status."', customer_see='".$customersee."', access_type='".$access_type."', member_type='".$member_type."', login='".$login."', password='".$password."' where staff_id = '".$staff_id."'");
echo"<script>window.location.href='profile.php?business_id=$business_id&staff_id=$staff_id';</script>";
}
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="LTR" lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Online Appointment</title>

<base >
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>Staff Management</title>

</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">


<table cellpadding="0" cellspacing="0" border="0"><tr>
  <td style="background:url(images/top.gif) repeat-x top; ">
<table cellpadding="0" cellspacing="0" border="0" style="width:764px" align="center"> 
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:57">
				<tr>
					<td height="57">
<? html_header(); ?>					</td>
				</tr>
			</table>


		</td>
	</tr>
	<tr>
		<td>





<table border="0" width="105%" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top" class="col_left">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_left">
	<tr><td width="100%">
		<table border="0" cellspacing="0" cellpadding="0">
<tr><td>

<table border="0" width="100%" cellspacing="0" cellpadding="0" class="">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  class="" height="91">
  <tr>
    <td align="center" height="91">
    <img border="0" src="images/logo.jpg" width="208" height="86"></td>
  </tr>
</table>
</td>
  </tr>
</table>
</td></tr>


          <tr>
            <td>
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="box_header_txt" height="48">
  <tr>
    <td style="background-image: url(images/1_bg2-2.gif)" height="1">
      <p style="margin-top: 16"> </td>
  </tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="0"   style="border-bottom:12px solid #ffffff;">
  <tr>
    <td>
    <table border="0" width="100%" cellspacing="0" cellpadding="0"  style="margin-bottom:0px;background:#7C7C7C url(images/1_line.gif) no-repeat left bottom;" >
  <tr>
    <td  style="padding:3px 16px 8px 25px;">
      <table width="100%" border="0">
        <tr>
          <td colspan="2" align="left"><a href="profile.php?business_id=<? echo $business_id;?>&staff_id=<? echo $staff_id;?>" class="topmenulink">Profile Information </a> </td>
        </tr>
        <tr>
          <td colspan="2"><a href="staff_offdays.php?business_id=<? echo $business_id;?>&staff_id=<? echo $staff_id;?>" class="topmenulink">Days Off </a></td>
          </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</td>
  </tr>
</table>
            </td>
          </tr>


          <tr>
            <td class="">&nbsp;
</td>
          </tr>

		</table>
	</td>
	<td><img src="images/spacer.gif" border="0" alt="" width="15" height="1"></td></tr>
</table>

    </td>

    <td width="100%" valign="top">
<table border="0" width="100%" cellspacing="0" cellpadding="0"  class="cont_header_txt">
  <tr>
    <td>
			<table border="0" cellpadding="0" cellspacing="0" bgcolor="#EAEAEA" class="cont_header_txt">
				<tr>
					<td><img src="images/1_q1.gif" border="0" alt="" width="45" height="39"></td>
					<td style="width:100%"><? echo $record['first_name']." ".$record['last_name'];?> </td>
					<td><img src="images/1_q2.gif" border="0" alt="" width="10" height="39"></td>
				</tr>
			</table>										 
			</td>
  </tr>
</table>


						
						<table cellpadding="0" cellspacing="0" border="0" style="border:0px solid #DEDEDE; border-width:0px 1px 0px 1px;">
                          <tr>
                            <td style="background:#ffffff;border:0px solid #ffffff; border-width:18px 5px 10px 5px;"><!-- new_products //-->
                                <table width="" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFDBCA" class="table">
								<form name="frm" method="post" action="">
                                  <tr>
                                    <td height="25" colspan="2" bgcolor="#EAEAEA" class="H1">General information </td>
                                  </tr>
                                  <tr>
                                    <td width="33%" height="25" class="simpletxt">&nbsp;&nbsp;First Name</td>
                                    <td width="67%">
                                        <input name="f_name" type="text" id="f_name" value="<? echo $record['first_name'];?>">                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Last Name </td>
                                    <td>
                                        <input name="l_name" type="text" id="l_name"  value="<? echo $record['last_name'];?>">                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Screen Name </td>
                                    <td>
                                        <input name="s_name" type="text" id="s_name" value="<? echo $record['screen_name'];?>">                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Company&nbsp;(if Applicable)</td>
                                    <td>
                                        <input name="c_name" type="text" id="c_name" value="<? echo $record['company'];?>">                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Address</td>
                                    <td>
									    <textarea name="address" rows="3" id="address"><? echo $record['address'];?></textarea>                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;City</td>
                                    <td>
                                        <input name="city" type="text" id="city" value="<? echo $record['city'];?>">                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;State/Province</td>
                                    <td><input name="state" type="text" id="state" value="<? echo $record['state'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Zip/Postal Code </td>
                                    <td><input name="zip" type="text" id="zip" value="<? echo $record['zip'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Email Address </td>
                                    <td><input name="email" type="text" id="email" value="<? echo $record['email'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Home Phone </td>
                                    <td><input name="home" type="text" id="home" value="<? echo $record['phone'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Office phone </td>
                                    <td><input name="office" type="text" id="office" value="<? echo $record['office'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Mobile </td>
                                    <td><input name="mobile" type="text" id="mobile" value="<? echo $record['mobile'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Fax</td>
                                    <td><input name="fax" type="text" id="fax" value="<? echo $record['fax'];?>"></td>
                                  </tr>
                                  <tr>
                                    <td height="25" colspan="2" bgcolor="#EAEAEA" class="H1">Profile Information </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Status</td>
                                    <td valign="middle" class="simpletxt">
                                        <input name="status" type="radio" value="0" checked>
                                      Active &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                      <input name="status" type="radio" value="1">
                                      Inactive                                      <br>
                                      Note that Inactive staff members can still log in, but don't display as being available for appointments. 
                                      <br>
                                      <br>                                  	</td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Allow Customers to See </td>
                                    <td class="simpletxt">
                                      <input name="customersee" type="radio" value="0" checked>
                                      Yes
                                      &nbsp;
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <input name="customersee" type="radio" value="1">
                                    No									</td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Access Type </td>
                                    <td class="simpletxt">
                                        <input name="access_type" type="radio" value="1">
                                        Headquarters Administrator<BR>
                                        <input name="access_type" type="radio" value="2">
                                      </label>
                                    Call Center User<br>
                                    <label>
                                    <input name="access_type" type="radio" value="3">
                                    </label>
                                    Location Administrator<BR>
                                    <label>
                                    <input name="access_type" type="radio" value="4">
                                    </label>
                                    Location User<BR>
                                    <label>
                                    <input name="access_type" type="radio" value="5">
                                    </label>
                                    View Appointments Only User                                   </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Staff Member Type </td>
                                    <td class="simpletxt">
                                        <select name="member_type" id="member_type">
                                          <option value="<? echo $record['member_type'];?>"><? echo $record['member_type'];?></option>
                                          <option value="staff">Staff</option>
                                          <option value="manager">Manager</option>
                                        </select>                                    </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Login</td>
                                    <td class="simpletxt">
                                        <input name="login" type="text" id="login" value="<? echo $record['login'];?>">                                   </td>
                                  </tr>
                                  <tr>
                                    <td height="25" class="simpletxt">&nbsp;&nbsp;Password</td>
                                    <td class="simpletxt">
                                        <input name="password" type="text" id="password" value="<? echo $record['password'];?>">                                   </td>
                                  </tr>
                                  <tr>
                                    <td height="25" colspan="2" align="center" class="simpletxt"><label>
                                      <input name="Update" type="submit" class="button" id="Update" value="Update Profile">
                                    </label></td>
                                  </tr></form>
                                </table>
                              <table border="0" cellspacing="0" cellpadding="0" align="center" class="box_width_cont product">
                                  <tr>
                                    <td></td>
                                  </tr>
                              </table></td>
                          </tr>
                        </table>
						
						<table cellpadding="0" cellspacing="0" border="0">
							<tr>
								<td><img src="images/1_q4.gif" border="0" alt="" width="10" height="10"></td>
								<td style="width:100%; background-image:url(images/1_li1.gif)"></td>
								<td><img src="images/1_q3.gif" border="0" alt="" width="10" height="10"></td>
							</tr>
						</table>
						


		
		
		</td>

    <td class="col_right">

<table border="0"cellspacing="0" cellpadding="0" class="box_width_right">
	<tr><td></td>
		<td width="100%">
			<table border="0" cellspacing="0" cellpadding="0">
				<tr><td></td></tr>
			</table>
		</td>
	</tr>
</table>


    </td>
  </tr>
</table>



		</td>
	</tr>
	<tr>
		<td>
			<table cellpadding="0" cellspacing="0" border="0" style="height:98px; background-image:url(images/bot.gif)">
				<tr>
					<td>
						<table cellpadding="0" cellspacing="0" border="0" class="footer">
							<tr>									
								<td height="77"><img src="images/spacer.gif" border="0" alt="" width="25" height="1"></td>				
								<td style="width:207px"><br style="line-height:49px"><img src="images/p1.gif" border="0" alt="" width="145" height="24"><br></td>
							  <td style="width:532px">&nbsp;</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
</table></td></tr></table>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"></td>
  </tr>
</table>
</body>

</html>